using Microsoft.Win32;

namespace Bull.Core
{
    internal sealed class OpenFileDialogImpl : IOpenFileDialog
    {
        private OpenFileDialog _fileDialog;
        public bool? ShowDialog(string filter="")
        {
            _fileDialog = new OpenFileDialog ();
            if (!string.IsNullOrEmpty(filter))
                _fileDialog.Filter = filter;
            return _fileDialog.ShowDialog();
        }

        public string FileName {
            get
            {
                return _fileDialog != null ? _fileDialog.FileName : string.Empty;
            }
        }
    }
}